/*
 * Copyright (C) 2010-2011 Graz University of Technology, Austria. All Rights reserved. 
 *
 * Contact: Simone Kopeinik <simone.kopeinik@tugraz.at>
 * 	   Graz University of Technology, Knowledge Management Institute, Brückenkopfgasse 1/6, 8020 Graz 	
 * 	   <http://www.kmi.tugraz.at/>
 * 
 * This software is part of the TARGET platform developed by the
 * TARGET EC-funded project www.reachyourtarget.org
 *
 * This software is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 3.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * The GNU General Public License is available at <http://www.gnu.org/licenses/>.
 *
 */
package at.tugraz.kmi.css.cbkst2;

import javax.annotation.Nonnull;

/**
 * 
 * Interface for an editable Knowledge Structure. A knowledge Structure can be
 * be defined either on a Set of {@link CbKSTCompetence} or
 * {@link CbKSTPerformance} objects.
 * 
 * @author Georg Öttl <georg.oettl@gmail.com>
 * 
 * @param <V>
 *            Either a {@link CbKSTCompetence} or a {@link CbKSTPerformance}
 */
public interface PrerequesiteOrderSet<V extends CbKSTVertex> extends
		ImmutablePrerequesiteOrderSet<V> {



	/**
	 * Adds a vertex to this structure.
	 * 
	 * @param vertex
	 *            The vertex to add.
	 * @return true if the vertex was added, false otherwise.
	 */
	boolean add(@Nonnull V vertex);

	/**
	 * Adds a new {@link PrerequesiteRelation} to this structure. Adding a
	 * prerequisite from ancestor to descendant has the meaning that the
	 * ancestor is a prerequisite to the descendant.
	 * 
	 * @param prerequisite
	 *            The prerequisite to add.
	 * 
	 * @return true if the deletion succeeded. false otherwise.
	 */
	boolean addPrerequesite(@Nonnull PrerequesiteRelation prerequisite);

	/**
	 * Removes a {@link PrerequesiteRelation}.
	 * 
	 * @param prerequisite
	 *            The prerequisite to be removed.
	 * 
	 * @return true if the deletion succeeded. false otherwise.
	 */
	boolean removePrerequesite(@Nonnull PrerequesiteRelation prerequisite);

	// Uswful methods for SWING

	/**
	 * Adds all Competences from the passed set into this set.
	 * 
	 * @param set
	 *            The set to be inserted.
	 */
	void addAll(ImmutablePrerequesiteOrderSet<V> set);

}